package com.heima.behavior.feign;

import com.heima.behavior.service.AdBehaviorService;
import com.heima.client.behavior.IBehaviorClient;
import com.heima.model.common.dtos.LikesBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class BehaviorClient implements IBehaviorClient {
    @Autowired
    private AdBehaviorService adBehaviorService;

    /**
     * 评论点赞
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/likesBehavior")
    public ResponseResult like(@RequestBody LikesBehaviorDto likesBehaviorDto) {
        return adBehaviorService.like(likesBehaviorDto);
    }
}
